/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.webapp.model;

import java.io.Serializable;
import javax.persistence.AssociationOverride;
import javax.persistence.AssociationOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "courseteacherclass")
//@AssociationOverrides({@AssociationOverride(name = "teacherclasses",joinColumns = @JoinColumn(name = "courseteacherid")) })
public class Classing implements Serializable
{
    @Id
    @GeneratedValue
    @Column(name = "courseteacherclass_id")
    private int courseteacherclass_id;
    
    @Column(name = "courseteacher_id")
    private int courseteacher_id;
    
    @Column(name = "class_id")
    private int class_id;
    
    //@ManyToOne(targetEntity=Coursing.class)
    //@JoinColumn(name="courseteacherid" , referencedColumnName="id")
    //@ManyToOne(fetch=FetchType.EAGER)
    @ManyToOne
    @JoinColumn(name="courseteacher_id", insertable = false, updatable = false, nullable=false)
    private Coursing coursing;
    

    public int getCourseteacherclass_id() {
        return courseteacherclass_id;
    }

    public void setCourseteacherclass_id(int courseteacherclass_id) {
        this.courseteacherclass_id = courseteacherclass_id;
    }

    public int getCourseteacher_id() {
        return courseteacher_id;
    }

    public void setCourseteacher_id(int courseteacher_id) {
        this.courseteacher_id = courseteacher_id;
    }

    public int getClass_id() {
        return class_id;
    }

    public void setClass_id(int class_id) {
        this.class_id = class_id;
    }

    public Coursing getCoursing() {
        return coursing;
    }

    public void setCoursing(Coursing coursing) {
        this.coursing = coursing;
    }
}
